Test Series - Data Structure

Test Number 46/115

Q: The self organizing list improves the efficiency of _______
A. binary search
B. jump search
C. sublist search
D. linear search
Solution: Linear search in a linked list has time complexity O(n). To improve the efficiency of the linear search the self organizing list is used. A self-organizing list improves the efficiency of linear search by moving more frequently accessed elements towards the head of the list.
Q: Which of the following is true about the Move-To-Front Method for rearranging nodes?
A. node with highest access count is moved to head of the list
B. requires extra storage
C. may over-reward infrequently accessed nodes
D. requires a counter for each node
Solution: In Move-To-front Method the element which is searched is moved to the head of the list. And if a node is searched even once, it is moved to the head of the list and given maximum priority even if it is not going to be accessed frequently in the future. Such a situation is referred to as over-rewarding.
Q: What technique is used in Transpose method?
A. searched node is swapped with its predecessor
B. node with highest access count is moved to head of the list
C. searched node is swapped with the head of list
D. searched nodes are rearranged based on their proximity to the head node
Solution:  In Transpose method, if any node is searched, it is swapped with the node in front unless it is the head of the list. So, in Transpose method searched node is swapped with its predecessor.
Q: The worst case running time of a linear search on the self organizing list is ____
A. O(1)
B. O(logn)
C. O(n)
D. O(n2)
Solution: Worst case occurs when the element is located at the very end of list. So n comparisons must be made to the locate element. So the worst case running time of linear search on self organizing list is O(n).
Q: Which of the following data structure is preferred to have lesser search time when the list size is small?
A. search tree
B. sorted list
C. self organizing list
D. linked list
Solution: Self-organizing list is easy and simple to implement than search tree and it requires no additional space. So using self organizing list is preferred when list size is small.
Q: In _____________ method, whenever a node is accessed, it might move to the head of the list if its number of accesses becomes greater than the records preceding it.
A. least recently used
B. count
C. traspose
D. exchange
Solution:  In the count method, the number of times a node was accessed is counted and is stored in a counter variable associated with each node. Then the nodes are arranged in descending order based on their access counts. And the node with highest access count is head of the list.
Q: Symbol tables during compilation of program is efficiently implemented using __________
A. a singly linked list
B. a doubly linked list
C. a self organizing list
D. an array
Solution: Self organizing list allows fast sequential search and it is simple to implement and requires no extra storage. Self-organizing list is used to implement the symbol table.
Q: Which of the following method performs poorly when elements are accessed in sequential order?
A. count method
B. move to front method
C. transpose meth
D. ordering method
Solution: Move-to-front method performs poorly when the elements are accessed in sequential order, especially if that sequential order is then repeated multiple times.
Q: The self organizing list improves _____
A. average access time
B. insertion
C. deletion
D. binary search
Solution: The self-organizing list rearranges the nodes based on the access probabilities of the nodes. So the required elements can be located efficiently. Therefore, self-organizing list is mainly used to improve the average access time.
Q: Which of the following is not the rearranging method used to implement self-organizing lists?
A. count method
B. move to front method
C. ordering method
D. least frequently used
Solution: Least frequently used is a buffer replacement policy, while other three are methods to reorder the nodes in the self-organizing lists based on their access probability.

You Have Score    /10